﻿<UserControl x:Class="XWord.WPF.ApplicationFramework.TestModules.validationsimple.ValidataionBasic"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
             xmlns:validations="http://schemas.xword.com/winfx/xaml/info"
             mc:Ignorable="d" 
             d:DesignHeight="300" d:DesignWidth="300">
    <Grid>
        <TabControl>
            <TabItem Header="RequiredValidator">
                <StackPanel>
                    <TextBox x:Name="Element_TextBox" HorizontalAlignment="Left" Width="100"></TextBox>
                    <validations:RequiredValidator
                           Property="{Binding Text,ElementName=Element_TextBox}"/>
                </StackPanel>
            </TabItem>
            <TabItem Header="StringLengthValidator">
                <StackPanel>
                    <TextBox x:Name="Element_StringLengthValidatorTextBox" HorizontalAlignment="Left" Width="100"></TextBox>
                <validations:StringLengthValidator MinimumLength="5" MaximumLength="10"
                           Property="{Binding Text,ElementName=Element_StringLengthValidatorTextBox}"/>
                </StackPanel>
            </TabItem>
            <TabItem Header="EmailValidator">
                <StackPanel>
                    <TextBox x:Name="Element_EmailValidatorTextBox" HorizontalAlignment="Left" Width="100"></TextBox>
                    <validations:EmailValidator
                           Property="{Binding Text,ElementName=Element_EmailValidatorTextBox}"/>
                </StackPanel>
            </TabItem>
            <TabItem Header="RegularExpressionValidator">
                <StackPanel>
                    <TextBox x:Name="Element_RegularExpressionValidatorTextBox" HorizontalAlignment="Left" Width="100"></TextBox>
                    <validations:RegularExpressionValidator Pattern="\b[0-9]{5}(?:-[0-9]{4})?\b" ErrorMessage="ZIP code error"
                           Source="{Binding ElementName=Element_RegularExpressionValidatorTextBox}" 
                           Property="{Binding Text,ElementName=Element_RegularExpressionValidatorTextBox}"/>
                </StackPanel>
            </TabItem>
            <TabItem Header="CombineValidate">
                <StackPanel>
                    <TextBox x:Name="Element_CombineValidateTextBox" HorizontalAlignment="Left" Width="100"></TextBox>
                    <validations:EmailValidator
                           Property="{Binding Text,ElementName=Element_CombineValidateTextBox}"/>
                    <validations:RequiredValidator Property="{Binding Text,ElementName=Element_CombineValidateTextBox}"/>
                    <validations:StringLengthValidator MinimumLength="5" MaximumLength="10"
                           Property="{Binding Text,ElementName=Element_CombineValidateTextBox}"/>
                </StackPanel>
            </TabItem>
        </TabControl>
    </Grid>
</UserControl>
